﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data;
using Entities;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class Service : System.Web.Services.WebService
{
    public Service()
    {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public DataTable ListAccount(String ClientNumber)
    {
        return BankDAL.Instance.ListAccount(ClientNumber);
    }
    [WebMethod]
    public DataTable AccountDetail(String AccountNumber)
    {
        return BankDAL.Instance.AccountDetail(AccountNumber);
    }
    [WebMethod]
    public bool Deposit(String ACN, String Balance)
    {
        return BankDAL.Instance.Deposit(ACN, Balance);
    }
    [WebMethod]
    public bool WithDraw(String ACN, String Balance)
    {
        return BankDAL.Instance.WithDraw(ACN, Balance);
    }
    [WebMethod]
    public DataTable AccountTypeName(int AccountTypeID)
    {
        return BankDAL.Instance.AccountTypeName(AccountTypeID);
    }
    [WebMethod]
    public bool LastTransaction(String ACN)
    {
        return BankDAL.Instance.LastTransaction(ACN);
    }
    [WebMethod]
    public bool InsertTransaction(String TransType, String ACN, String Amount, String Description, int Status)
    {
        return BankDAL.Instance.InsertTransaction(TransType, ACN, Amount, Description, Status);
    }
    [WebMethod]
    public DataTable ViewTransactionByDate(DateTime begindate, DateTime enddate, String ACN)
    {
        return BankDAL.Instance.ViewTransactionByDate(begindate, enddate, ACN);
    }

    //dang nhap
    [WebMethod]
    public DataTable LoginBank(String ClientNumber, String Password)
    {
        return BankDAL.Instance.LoginBank(ClientNumber, Password);
    }
    //chuyen tien sang ngan hang khac (server2)
    [WebMethod]
    public bool TransfertoServer2(String ACN, String Balance)
    {
        server_2.Service server2 = new server_2.Service();
        return server2.Deposit(ACN, Balance);
    }
    [WebMethod]
    public bool SaveTransaction(String SampleTName, String ACN, String Beneficiary, String ToACN, String Bank, String City, String Branch, float TransactionLimit, String Money, String TransactionContent, int Category)
    {
        return BankDAL.Instance.SaveTransaction(SampleTName,ACN,Beneficiary,ToACN,Bank,City,Branch,TransactionLimit,Money,TransactionContent,Category);
    }

}
